package Tools.MyPool;

import lombok.extern.slf4j.Slf4j;

@Slf4j(topic = "c.MyPool_Test")
public class MyPool_Test {
    public static void main(String[] args) {
        Runnable r = () -> {
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            log.debug("running");
        };
        A a = new A(r);

        a.start();
    }


}

class A extends Thread{

    private Runnable task;

    public A(Runnable task) {
        this.task = task;
    }

    @Override
    public void run() {
        task.run();
    }
}